/* 扫描二维码页面样式 */
.scan-qrcode-container {
  padding: 24px;
  min-height: calc(100vh - 120px);
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  margin-bottom: 8px;
  color: #262626;
}

.page-description {
  color: #8c8c8c;
  margin-bottom: 0;
  line-height: 1.6;
}

.error-message {
  padding: 12px 16px;
  background-color: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  color: #cf1322;
  font-size: 14px;
  margin-bottom: 16px;
}

.scan-container {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

.scanner-view {
  padding: 24px;
  text-align: center;
}

.loading-state {
  padding: 60px 24px;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 360px;
  margin: 0 auto 24px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
}

.scan-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.no-scan-state {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
}

/* 扫描框效果 */
.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 240px;
  margin-top: -120px;
  margin-left: -120px;
  border: 2px solid #1890ff;
  border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.scan-frame:before,
.scan-frame:after,
.scan-frame > :before,
.scan-frame > :after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #1890ff;
  border-style: solid;
}

.scan-frame:before {
  top: -2px;
  left: -2px;
  border-width: 2px 0 0 2px;
}

.scan-frame:after {
  top: -2px;
  right: -2px;
  border-width: 2px 2px 0 0;
}

.scan-frame > :before {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 2px 2px;
}

.scan-frame > :after {
  bottom: -2px;
  right: -2px;
  border-width: 0 2px 2px 0;
}

/* 扫描线动画 */
.scan-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 2px;
  margin-left: -120px;
  background: linear-gradient(90deg, transparent, #1890ff, transparent);
  transform: translateY(-50%);
  animation: scanLineMove 2s linear infinite;
}

@keyframes scanLineMove {
  0% {
    top: 20%;
  }
  50% {
    top: 80%;
  }
  100% {
    top: 20%;
  }
}

.scan-actions {
  display: flex;
  justify-content: center;
}

.device-info-view {
  padding: 24px;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.device-name {
  margin: 0;
  color: #262626;
}

.info-actions {
  flex-shrink: 0;
}

.device-form .ant-form-item {
  margin-bottom: 16px;
}

.device-form .ant-form-item-label > label {
  font-weight: 500;
  color: #262626;
}

.device-form .ant-input,
.device-form .ant-select,
.device-form .ant-picker {
  border-radius: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.form-grid .ant-form-item {
  margin-bottom: 0;
}

.form-grid .ant-form-item:last-child {
  grid-column: 1 / -1;
}

.scan-time {
  margin-top: 16px;
  padding: 12px;
  background-color: #f5f5f5;
  border-radius: 6px;
  text-align: right;
  color: #8c8c8c;
  font-size: 14px;
}

.usage-tips {
  margin-top: 24px;
  padding: 16px;
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 6px;
}

.tips-title {
  font-weight: 500;
  color: #1890ff;
  margin-bottom: 8px;
  font-size: 14px;
}

.tips-list {
  margin: 0;
  padding-left: 20px;
}

.tips-list li {
  font-size: 13px;
  color: #595959;
  line-height: 1.8;
  margin-bottom: 4px;
}

.tips-list li:last-child {
  margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .scan-qrcode-container {
    padding: 16px;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .scanner-view {
    padding: 16px;
  }
  
  .video-container {
    width: 100%;
    height: 280px;
    margin-bottom: 16px;
  }
  
  .scan-frame {
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
  }
  
  .scan-line {
    width: 200px;
    margin-left: -100px;
  }
  
  .device-info-view {
    padding: 16px;
  }
  
  .info-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .info-actions {
    width: 100%;
  }
  
  .info-actions .ant-space {
    display: flex;
    width: 100%;
  }
  
  .info-actions .ant-btn {
    flex: 1;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .video-container {
    height: 240px;
  }
  
  .scan-frame {
    width: 180px;
    height: 180px;
    margin-top: -90px;
    margin-left: -90px;
  }
  
  .scan-line {
    width: 180px;
    margin-left: -90px;
  }
}